package org.itstack.navice.chat.ui.view.chat;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.stage.StageStyle;
import org.itstack.navice.chat.ui.view.UIObject;

import java.awt.*;
import java.io.IOException;

public abstract class ChatInit extends UIObject {
        private static final String RESOURCE_NAME = "/fxml/chat/chat.fxml";
        public IChatEvent chatEvent;

        public String userId;       // 用户ID
        public String userNickName; // 用户昵称
        public String userHead;


        public Button bar_portrait;
        public Button bar_chat;
        public Button bar_friend;
        public Button bar_location;
        public Button bar_set;
        public TextArea txt_input;

    ChatInit( IChatEvent chatEvent){
        this.chatEvent=chatEvent;
       try {
           root =FXMLLoader.load(getClass().getResource(RESOURCE_NAME));
       } catch (IOException e) {
           e.printStackTrace();
       }
       Scene scene = new Scene(root);
       scene.setFill(Color.TRANSPARENT);
       setScene(scene);
       initStyle(StageStyle.TRANSPARENT);
       setResizable(false);
       this.getIcons().add(new Image("/fxml/login/img/logo.png"));
       obtain();
       initView();
       initEventDefine();

   }

   private void obtain(){
       bar_portrait = $("bar_portrait", Button.class);
       bar_chat = $("bar_chat", Button.class);
       bar_friend = $("bar_friend", Button.class);
       bar_location = $("bar_location", Button.class);
       bar_set = $("bar_set", Button.class);
   }

}
